<link rel="stylesheet" href="__PUBLIC__/admin/css/bootstrap.css">
<style type="text/css">
    .modals {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1050;
        display: none;
        outline: 0;
    }
</style>
            <div class="content"> 
                <div class="operation">
                    <div class="pull-left">
                    </div>
                    <div class="right-box">
                        <input type="search" placeholder="搜索..." name="search" class="search" value="{$search}">
                        <span class="glyphicon glyphicon-search" id="sub"></span>
                    </div>
                </div>
                <table class="table agent">
                    <tbody>
                    <tr>
                        <volist name="header" id="vo">
                            <th>{$vo}
                                <span>
                                    <a class="glyphicon glyphicon-triangle-top"></a>
                                    <a class="glyphicon glyphicon-triangle-bottom"></a>
                                </span>
                            </th>
                        </volist> 
                    </tr>
                        <volist name="list" id="vo">
                        <tr>
                            <volist name="vo" id="v">
                                <td>{$v}</td>
                            </volist>
                        </tr>
                        </volist>       
                </tbody>
                </table>
                <div class="page">
                    <span>共 {$count} 条</span>
                    <div class="paging">
                        {$page}
                    </div>
                    前往<input type="text" value="{$p}" name='page' onchange="mychange()">页
                </div>    
            </div>
        
    <div class="modal fade bs-example-modal-lg">
        <div class="modal-dialog modal-lg">
            <div class="modal-content details">
                <div>
                    <h3>网站信息：</h3>
                    <ul>
                        <li> 域名：<span class="yuming">www.bonnidee.cn</span></li>
                        <li> FTP：ftp://:@<span class="ftp"></span>  </li>
                        <li>后台：账号    密码</li>
                        <li class="title"> 标题：<button class="tdk">一键提取TDK</button></li>
                        <li class="keyword"> 关键字：</li>
                        <li class="desc"> 描述：</li>
                    </ul>
                </div>
                <div class="details-set">
                    <h3>价格配置：</h3>
                    <ul>
                        <li>关键词：<span class="keyword">包装箱定制</span></li>
                        <li>网址：<span class="site">www.shbdd56.com</span>/</li>
                        <li>搜索引擎：<span class="seo">百度</span> </li>
                        <li class="price">
                            <label>价格：</label>
                            <div>
                                <p>前<input type="text" value="10" name="rank">名<input type="text" value="15.6" name="amount">元/天</p>
                                <p>前<input type="text">名<input type="text">元/天</p>
                                <p>前<input type="text">名<input type="text">元/天</p>
                                <p>前<input type="text">名<input type="text">元/天</p>
                            </div>
                        
                        </li>
                    </ul>
                </div>
            
            </div>
        </div>
    </div>
    <div class="modals fade bs-example-modal-lgg">
            <div class="modal-dialog modal-lg">
              <div class="modal-content">
                    <table class="table" id="tables">
                      
                    </table>
                  <div class="page" style="display: none">
                      <span>共 800 条</span>
                      每页
                      <select name="" id="">
                          <option value="10">10</option>
                          <option value="20">20</option>
                          <option value="30">30</option>
                          <option value="40">40</option>
                      </select>条
                      <div class="paging">
                          <a href="" title="首页" class="glyphicon glyphicon-chevron-left"></a>
                          <a href="" class="active">1</a>
                          <a href="">2</a>
                          <a href="">3</a>
                          <a href="">4</a>
                          <a href="">5</a>
                          <span>...</span>
                          <a href="">23</a>
                          <a href="" title="上一页" class="glyphicon glyphicon-chevron-right"></a>
                      </div>
                      前往<input type="text" value="10">页
                  </div>    
              </div>
            </div>
          </div>

<script type="text/javascript">
    $("#sub").click(function(){
        var search = $('.search').val();
        window.location.href = "/Agent/Agent/ptindex.html?search="+search;
    });

    function mychange(){
      var page =  $('input[name="page"]').val();
      window.location.href = "/index.php/Agent/Agent/ptindex/p/"+page;
    }

    document.onclick = function(e) {
        var modal = 　$('.modal').css('display');
        var modals = 　$('.modals').css('display');
        // console.log(modal);
        if(modal == 'block'){
            $('.modal').css('display','none');
            $(".modal").removeClass("show");
            $("body").removeClass("modal-open");
            $("body").css("padding-right",'0');
            $(".modal-backdrop").remove();
        }
        if(modals == 'block'){
            $('.modals').css('display','none');
            $(".modals").removeClass("show");
            $("body").removeClass("modal-open");
            $("body").css("padding-right",'0');
            $(".modal-backdrop").remove();
        }　　　　　
    }


   $(".add").click(function(){

        var user_id = $(this).attr('user_id');
        $.ajax({
            url:'/Agent/Agent/udetails',    //请求的url地址
            dataType: "JSON",   //返回格式为json
            async: true,//请求是否异步，默认为异步，这也是ajax重要特性
            type: "post",   //请求方式
            data:{
                user_id:user_id,
            },

            success: function (data) {
                if(data.state==1){
                    console.log(data.data)
                    var html = '<tr><th>序号 <span><a class="glyphicon glyphicon-triangle-top"></a><a class="glyphicon glyphicon-triangle-bottom"></a></span></th><th>客户</th><th>交易时间</th><th>交易类别</th><th>达标词数</th><th>资金变动</th><th>备注</th></tr>';
                    $.each(data.data, function (i, item) {
                        html += '<tr>';
                        $.each(item, function (q, items) {
                            html += "<td>"+items+"</td>";
                        });
                        html += '</tr>';
                    });
                    $('#tables').html();
                    $('#tables').html(html);

                }else{
                    console.log(data.data)
                    return false;
                }
            }
        })

        $("body").addClass("modal-open");
        $(".modals").addClass("show");
        $('.modals').css('display','block');
        $('input[name="act"]').val('edit');
        $("body").append("<div class='modal-backdrop fade show'></div>");

    });

    $(".detail").click(function(){
        var wid = $(this).attr('wid');
        $.ajax({
            url:'/Agent/Agent/ftp',    //请求的url地址
            dataType: "JSON",   //返回格式为json
            async: true,//请求是否异步，默认为异步，这也是ajax重要特性
            type: "post",   //请求方式
            data:{
                wid:wid,
            },
            success: function (data) {
                if(data.state==1){
                    console.log(data.data)
                    $('.site').html(data.data.site);
                    $('.yuming').html(data.data.site);
                    $('.keyword').html(data.data.keyword);
                    $('.seo').html(data.data.seo);
                    $('.ftp').html(data.data.ftp_ip);
                    $('input[name="amount"]').val(data.data.price);
                }else{
                    console.log(data.data)
                    return false;
                }
            }
        })

        $("body").addClass("modal-open");
        $(".modal").addClass("show");
        $('.modal').css('display','block');
        $("body").append("<div class='modal-backdrop fade show'></div>");

    });
    
    $(".modal-content").click(function(event){
        event.stopPropagation();
    });

    $("#detail").click(function(event){
        event.stopPropagation();
    });

    $(".add").click(function(event){
        event.stopPropagation();
    });

     $(".detail").click(function(event){
        event.stopPropagation();
    });
</script>    
